package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.JiajiaBanner;
import com.ruoyi.system.mapper.JiajiaBannerMapper;
import com.ruoyi.system.service.IJiajiaBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 轮播图Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-10-15
 */
@Service
public class JiajiaBannerServiceImpl implements IJiajiaBannerService
{
    @Autowired
    private JiajiaBannerMapper jiajiaBannerMapper;

    /**
     * 查询轮播图
     * 
     * @param id 轮播图主键
     * @return 轮播图
     */
    @Override
    public JiajiaBanner selectJiajiaBannerById(Long id)
    {
        return jiajiaBannerMapper.selectJiajiaBannerById(id);
    }

    /**
     * 查询轮播图列表
     * 
     * @param jiajiaBanner 轮播图
     * @return 轮播图
     */
    @Override
    public List<JiajiaBanner> selectJiajiaBannerList(JiajiaBanner jiajiaBanner)
    {
        return jiajiaBannerMapper.selectJiajiaBannerList(jiajiaBanner);
    }

    /**
     * 新增轮播图
     * 
     * @param jiajiaBanner 轮播图
     * @return 结果
     */
    @Override
    public int insertJiajiaBanner(JiajiaBanner jiajiaBanner)
    {
        return jiajiaBannerMapper.insertJiajiaBanner(jiajiaBanner);
    }

    /**
     * 修改轮播图
     * 
     * @param jiajiaBanner 轮播图
     * @return 结果
     */
    @Override
    public int updateJiajiaBanner(JiajiaBanner jiajiaBanner)
    {
        return jiajiaBannerMapper.updateJiajiaBanner(jiajiaBanner);
    }

    /**
     * 批量删除轮播图
     * 
     * @param ids 需要删除的轮播图主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaBannerByIds(String ids)
    {
        return jiajiaBannerMapper.deleteJiajiaBannerByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除轮播图信息
     * 
     * @param id 轮播图主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaBannerById(Long id)
    {
        return jiajiaBannerMapper.deleteJiajiaBannerById(id);
    }
}
